<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>专业详情页</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
    <link rel="stylesheet" href="majorStyle.css">
</head>

<body id="page-top">
<div id="app">

    <!-- 固定导航栏 -->
        <div class="container">
            <div class="row nav upnav">
                <div class="col-lg-4"><h1><div style="font-family: 'Arial'; color: black;">山东省高考志愿系统</div></h1></div>
                <div class="col lg-4"></div>
            </div>
            <div class="row nav botnav">
                <div class="col-lg-2"></div>
                <div class="col-lg-8  row">
                    <div class="col-lg-2">
                        <a href="../index.html">
                            首页
                        </a>
                    </div>
                    <div class="col-lg-2">
                        <a href="../universities.html">
                            院校查找
                        </a>
                    </div>
                    <div class="col-lg-2">
                        <a href="majors.html" style="font-weight: bold; color: rgb(57, 83, 131);">
                            专业查找
                        </a>
                    </div>
                    <div class="col-lg-2">
                        <a href="../recommend.html">
                            志愿推荐
                        </a>
                    </div>
                    <div class="col-lg-2">
                        <a href="../ranking.html">
                            大学排行
                        </a>
                    </div>
                    <div class="col-lg-2">
                        <a href="javascript:;" @click="toAdmin()">
                            管理员
                        </a>
                    </div>
                </div>
            </div>
        </div>
    

    <div id="wrapper">
        
        <div class="d-flex flex-column" id="content-wrapper">
            <div id="content">
                <div class="container">
                    
                    <div class="majorHeader" style="margin-top: 30px;">
                        
                        <div class="row">
                            <div class="col-lg-2"><img src="major.png" class="majorImg"></div>
                            <div class="col-lg-10 row">
                                <div class="col-lg-12">
                                    <div class="majorName">{{major.name}}</div>
                                </div>
                                <div class="col-lg-12">
                                    <div class="majorTags">
                                        <span class="majorTag">{{major.type}}</span>
                                        <span class="majorTag">本科</span>
                                        <span class="majorTag">四年制</span>
                                        <span class="majorTag">学士学位</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <div class="row" style="margin-top: 30px;">
                        <div class="col-md-11" style="margin-left: 50px;">
                            <div class="card" style="margin-top: 30px;">
                                <div class="card-header">
                                    <h5 class="mb-0" style="color: black; font-size: 25px;">专业介绍</h5>
                                </div>
                                <div class="card-body">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <nav class="navbar navbar-light navbar-expand-md">
                                                <div class="container-fluid">
                                                    <div class="collapse navbar-collapse" id="navcol-3">
                                                        {{major.describes}}
                                                    </div>
                                                </div>
                                            </nav>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="card" style="margin-top: 30px;">
                                <div class="card-header">
                                    <h5 class="mb-0" style="color: black; font-size: 25px;">培养目标</h5>
                                </div>
                                <div class="card-body">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <nav class="navbar navbar-light navbar-expand-md">
                                                <div class="container-fluid">
                                                    <div class="collapse navbar-collapse" id="navcol-4">
                                                        {{major.goal}}
                                                    </div>
                                                </div>
                                            </nav>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="card" style="margin-top: 30px;">
                                <div class="card-header">
                                    <h5 class="mb-0" style="color: black; font-size: 25px;">培养要求</h5>
                                </div>
                                <div class="card-body">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <nav class="navbar navbar-light navbar-expand-md">
                                                <div class="container-fluid">
                                                    <div class="collapse navbar-collapse" id="navcol-5">
                                                        {{major.needed}}
                                                    </div>
                                                </div>
                                            </nav>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="card" style="margin-top: 30px;">
                                <div class="card-header">
                                    <h5 class="mb-0" style="color: black; font-size: 25px;">知识能力</h5>
                                </div>
                                <div class="card-body">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <nav class="navbar navbar-light navbar-expand-md">
                                                <div class="container-fluid">
                                                    <div class="collapse navbar-collapse" id="navcol-6">
                                                        {{major.ability}}
                                                    </div>
                                                </div>
                                            </nav>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="card" style="margin-top: 30px;">
                                <div class="card-header">
                                    <h5 class="mb-0" style="color: black; font-size: 25px;">主要课程</h5>
                                </div>
                                <div class="card-body">
                                    <ul class="list-group">
                                        <li class="list-group-item">
                                            <nav class="navbar navbar-light navbar-expand-md">
                                                <div class="container-fluid">
                                                    <div class="collapse navbar-collapse" id="navcol-7">
                                                        {{major.courses}}
                                                    </div>
                                                </div>
                                            </nav>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
<!-- footer -->
            <div class="footer container">
                <div class="footertext">
                    <div>项目经理: 李永琪</div>
                    <div>邮箱: 1250025948@qq.com</div>
                    <div>团队成员: 王兴胜 周经纬 刘宇航</div>
                </div>
            </div>

        </div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
    </div>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/js/theme.js"></script>
</div>
</body>

</html>

<script src="../js/vue.js"></script>
<script src="../js/axios.min.js"></script>
<script>
    const app = new Vue({
        el:"#app",
        data:{
            major:{},
            id:"",
            name:""
        },
        methods:{
            queryMajorByName(){
                const _this = this;
                axios.get("http://localhost:8080/majors/queryMajorByName?name="+encodeURI(this.name)).then((res)=>{
                    console.log(res.data);
                    console.log(this.name);
                    console.log(location.href);
                    _this.major = res.data;
                });
            },
            toAdmin(){
                if(window.localStorage.getItem("role") === 'administrator') location.href='../admin/user.html';
                else alert("非管理员 无授权进入管理员界面!")
            }
        },
        created(){
            if(window.localStorage.getItem("online")!=="on"){
                window.location='login.html';
            }else {
                const codeUrl = location.href.substring(location.href.indexOf("=") + 1);
                this.name = decodeURI(codeUrl);
                this.queryMajorByName();
            }
        }
    })
</script>